home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / Sample Code / Sample Editors⁄Viewers / Sound Editor / snd script < prev    next >
Encoding:
Text File  |  1995-12-11  |  1.0 KB  |  51 lines  |  [TEXT/ToyS]

  1.  
  2. tell application "Sound Editor Doc"
  3.     set mydoc to a reference to part id id
  4. end tell
  5.  
  6. tell application "SoundEditor (MW)"
  7.     tell mydoc
  8.         
  9.         -- copy the old recording quality and set to best
  10.         copy recording quality to oQuality
  11.         set recording quality to best
  12.         
  13.         -- stop if necessary
  14.         copy state to cState
  15.         if cState is not stopped then
  16.             stop
  17.         end if
  18.         
  19.         -- record for half the maximum possible time
  20.         copy max recording time to mTime
  21.         record
  22.         copy current time to cTime
  23.         repeat while cTime < mTime / 3
  24.             copy current time to cTime
  25.         end repeat
  26.         stop
  27.         
  28.         -- play the sound, pause halfway,
  29.         -- wait 3 seconds then continue
  30.         copy sound length to cLength
  31.         play
  32.         copy current time to cTime
  33.         repeat while cTime < cLength / 2
  34.             copy current time to cTime
  35.         end repeat
  36.         pause
  37.         copy 0 to counter
  38.         repeat while counter < 10000
  39.             copy counter + 1 to counter
  40.         end repeat
  41.         resume
  42.         
  43.         -- restore the old sound quality
  44.         if sound quality is not oQuality then
  45.             set recording quality to oQuality
  46.         end if
  47.         
  48.     end tell
  49. end tell
  50.  
  51.